<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>margin塌陷</title>
    <style>
        .outer {
            width: 400px;
            background-color: gray;
            overflow: hidden;
        }
        .insider1 {
            width: 100px;
            height: 100px;
            background-color: orange;
            /*下面这个代码有问题*/
            margin-top: 50px;
        }
        .insider2 {
            width: 100px;
            height: 100px;
            /*下面这个代码有问题*/
            margin-bottom: 50px;
            background-color: green;
        }
    </style>
</head>
<body>
<div class="outer">
    <div class="insider1">insider1</div>
    <div class="insider2">insider2</div>
</div>
<hr>
<img src="../../images/margin塌陷问题.png" width="500px">
</body>
</html>